{template:header}
<if="$this->forum['allowposting']">
<div id="title_show">
	{$moderator}
	<cite>{$lang['moderator']}:</cite>
	<div class="desc">
		{$forum['description']}&nbsp;<a href="rss.php{sessionurl}fid={$forum['id']}&amp;version=rss2.0&amp;limit=20" target="_blank"><img class="inline" src="images/<#IMAGE#>/rss.gif" alt="RSS" /></a>
	</div>
</div>
</if>
<div class="top_ad">{ads:thread,$forum['id']}</div>
<if="is_array( $forums->forum->forum_cache[ $fid ] )">
	<php>
	$cat_data = $forums->forum->foruminfo[ $fid ];
	$columns=0;
	</php>
	<div class="separate"><!-- separate block --></div>
	<if="$cat_data['forumcolumns']">
	{template:forumlist_column}
	<else>
	{template:forumlist_normal}
	</if>
	<div class="separate"><!-- separate block --></div>
</if>

<if="$this->forum['allowposting']">
{$moderator_form_header}
<div class="page_nav">
	<ul class="new_button">
		<li><strong><a href='newthread.php{sessionurl}f={$forum['id']}'>{$lang['newthread']}</a></strong></li>
		<if='$this->forum['allowpoll']'>
		<li><strong><a href='newpoll.php?{$sessionurl}f={$forum['id']}'>{$lang['newpoll']}</a></strong></li>
		</if>
	</ul>
	<div class="pages">{$forum['pagenav']}</div>
</div>
<div class="side_bar">
	<!-- 版面导航 -->
	<div class="side ttable">
		<h4>{$forum['name']}</h4>
		<if="$forum['forumicon']">
		<div class="side_inn thead">
			<div id="forum_icon">
				<img src="{$forum['forumicon']}" alt='' />
			</div>
		</div>
		</if>
		<if="$specialtopic">
		<div class="side_inn thead">
			{$specialtopic}
		</div>
		</if>
		<div class="side_inn side_forum">
			{$forum_navigation}
		</div>
	</div>
	<if="!$pp && $forum['forumrule']">
	<div class="side ttable">
		<h4>{$lang['forumrule']}</h4>
		<div class="side_inn">
			<div id='forum_rule'{$forum['change_forumrule_event']}>
			{$forumrule_content}
			</div>
		</div>
	</div>
	</if>
	<!-- 推荐主题 -->
	<if="$forum_commend_thread">
	<div class="side ttable">
		<h4>{$lang['mod_commend_thread']}</h4>
		<div class="side_inn">
			<dl>
				<foreach="$forum_commend_thread AS $tid => $c_thread">
				<dt><a href="showthread.php{sessionurl}t={$tid}">{$c_thread['title']}</a></dt>
				<dd>{$c_thread['postusername']}</dd>
				<dd class="time">{$c_thread['dateline']}</dd>
				</foreach>
			</dl>
		</div>
	</div>
	</if>
	<!-- 版面活跃会员 -->
	<if="$forum_active_user">
	<div class="side ttable">
	<h4>{$lang['forum_active_user']}</h4>
		<div class="side_inn">
			<ul class="user_list">
				<foreach="$forum_active_user AS $uid => $user">
				<li><a href="profile.php{sessionurl}u={$uid}">{$user['avatar']}</a><a href="profile.php{sessionurl}u={$uid}" title="{$user['name']}">{$user['cutname']}</a></li>
				</foreach>
			</ul>
		</div>
	</div>
	</if>
	<!-- 版面自定义区块 -->
	<if="$forum_area">
	<foreach="$forum_area AS $area">
	<div class="side ttable">
		<h4>{$area['name']}</h4>
		<div class="side_inn">
			<ul><foreach="$area AS $k => $are_content"><if="$k != 'name'"><li>{$are_content['title']}</li></if></foreach></ul>
		</div>
	</div>
	</foreach>
	</if>
</div>
<div class="forum_main">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class='ttable'>
<caption class='tcat'>
	<ul>
		<li><a href='forumdisplay.php{sessionurl}f={$forum['id']}&amp;filter=quintessence'>{$lang['quintessencethread']}</a></li>
	</ul>
	<h1><a href="forumdisplay.php{sessionurl}f={$forum['id']}">{$forum['name']}</a></h1>
</caption>
<thead class='thead'>
	<tr align="center">
		<th><img src="images/<#IMAGE#>/spacer.gif" alt="" /></th>
		<th width='68%' align='left'>{$lang['title']}</th>
		<th width='15%' align='left'>{$lang['postusername']}</th>
		<th width='12%' align='left'>{$lang['digg']}</th>
	</tr>
</thead>
<tbody class="tbody">
<if="$show['announce'] AND $announcement">
<foreach="$announcement AS $data">
	<tr align="center" class="item_list" onmouseover="this.className='item_change';" onmouseout="this.className='item_list';">
		<td>
			<img class="inline" src='images/<#IMAGE#>/announcement.gif' alt='' />
		</td>
		<td align='left' class='threadtitle'>
			<ul>
				<li class='time'>{$data['startdate']}</li>
			</ul>
			{$lang['_announcement']}: <h3><a href='announcement.php{sessionurl}id={$data['id']}'>{$data['title']}</a></h3>
		</td>
		<td align='left'>
			{$data['avatar']}
			<a href='profile.php{sessionurl}u={$data['userid']}'>{$data['username']}</a>
		</td>
		<td align='left' class="tdesc">
			{$data['views']} {$lang['thread_hits']}
		</td>
	</tr>
</foreach>
</if>
<if="$show['nopost'] OR !count($threadlist)">
	<tr align="center" class="item_list">
		<td colspan='4' style="line-height:3em;">{$lang['nothread']}</td>
	</tr>
<else>
<foreach="$threadlist AS $thread">
	<if="$thread['shownormal']">
	<tr class='item_change'>
		<td colspan='4'>{$lang['normalthread']}</td>
	</tr>
	</if>
	<if="$thread['visible']">
	<tr align="center" class="item_list" onmouseover="this.className='item_change';" onmouseout="this.className='item_list';">
	<else>
	<tr align="center" class="item_list_shaded">
	</if>
		<td>
			{$thread['folder_img']['icons']}
		</td>
		<td id='ttid{$thread['tid']}' class='threadtitle' align="left" title="{$thread['preview']}"{$thread['ajax_edit_thread_title']}>
			<if="$thread['specialtopic'] OR $thread['gotonewpost'] OR $thread['allrep'] <> 0 OR $thread['attach_img'] OR $thread['quintess'] OR $thread['sticky']">
			<ul id="t_suffix_{$thread['tid']}">
			<if="$thread['gotonewpost']">
				<li><a href='redirect.php{sessionurl}t={$thread['tid']}&amp;goto=newpost'><img src='images/<#IMAGE#>/newpost.gif' alt='{$lang['gotonewpost']}' hspace="2" /></a></li>
			</if>
			<if="$thread['allrep'] > 0">
				<li><img src='images/<#IMAGE#>/reputation.gif' alt='{$lang['allrepinfo']}: {$thread['allrep']}' /></li>
			<elseif="$thread['allrep'] < 0">
				<li><img src='images/<#IMAGE#>/badreputation.gif' alt='{$lang['allrepinfo']}: {$thread['allrep']}' /></li>
			</if>
			<if="$thread['attach_img']">
				<li><a href='#' onclick="PopUp('attachment.php{sessionurl}do=showthread&amp;tid={$thread['tid']}', 'Attach{$thread['tid']}', 500,400,'','','','','',1);return false;"  title=''><img src='images/<#IMAGE#>/attachment.gif' alt='{$lang['attachs']}' /></a></li>
			</if>
			<if="$thread['quintess']">
				<li><img id="quintessence_pic{$thread['tid']}" src='images/<#IMAGE#>/quintessence.gif' alt='{$lang['quintessence']}' /></li>
			</if>
			<if="$thread['pollstate']">
				<li><img src='images/<#IMAGE#>/poll.gif' alt='{$lang['_poll']}' /></li>
			</if>
			<if="$thread['sticky']">
				<li><img src='images/<#IMAGE#>/stick_{$thread['sticky']}.gif' alt="{$lang['_stickthread']}" /></li>
			</if>
			<if="$thread['specialtopic']">
				<li><em>{$thread['specialtopic']}</em></li>
			</if>
			</ul>
			</if>
			{$thread['ajax_edit_thread_title_attr']}
			{$thread['thread_checkbox']}
			<h3><a href="showthread.php{sessionurl}t={$thread['tid']}{$thread['extra']}"><span id="show{$thread['tid']}">{$thread['title']}</span></a></h3>
			<if="$thread['showpages']"><span class="mini_page">{$thread['showpages']}</span></if>
			<div class="tdesc">
				{$thread['post']} {$lang['thread_replies']}&nbsp;&nbsp;
				{$thread['views']} {$lang['thread_hits']}&nbsp;&nbsp;
				{$thread['lastpost']} {$lang['thread_update']}
			</div>
		</td>
		<td align="left">
			{$thread['avatar']}
			{$thread['postusername']}
			<div class='time'>{$thread['dateline']}</div>
		</td>
		<td align="left">
			<!-- 推荐指数 -->
			<div class="digg"{$thread['digg_event']}>
				<em id="digg_exponent_{$thread['tid']}">{$thread['digg_exps']}</em>
				<div id="digg_users_num_{$thread['tid']}" class="tdesc">{$thread['digg_users']}</div>
			</div>
			<!-- end -->
		</td>
	</tr>
</foreach>
</if>
<if="$bbuserinfo['is_mod'] && !empty($mod)">
	<tr class="item_change">
		<td colspan="4" align="left" id="post_op">
			<em>{$lang['threadaction']}</em>
			<input type='hidden' name='f' id='forum_id' value='{$forum['id']}' />
			<input type='hidden' name='s' value='{sessionid}' />
			<input type='hidden' name='posthash' value='{$posthash}' />
			<input type='hidden' value='' name='t' />
			<input type='hidden' value='{$pp}' name='pp' />
			<input type="checkbox" id="selectall" onclick="SelectTag();"  />
			{$mod}
			<script language='JavaScript' type="text/javascript">
			//<![CDATA[
				var Mform = document.modform;
				Mform.onkeydown = Mformkeydown;
				function Mformkeydown(){
					if(isIE && window.event.keyCode==13){
						window.event.returnValue = false;
					} else return;
				}
			//]]>
			</script>
		</td>
	</tr>
</if>
</tbody>
</table>
</div>
<if="$bbuserinfo['is_mod']">
</form>
</if>
<div class="page_nav">
	<ul class="new_button">
		<li><strong><a href='newthread.php{sessionurl}f={$forum['id']}'>{$lang['newthread']}</a></strong></li>
		<if='$this->forum['allowpoll']'>
		<li><strong><a href='newpoll.php?{$sessionurl}f={$forum['id']}'>{$lang['newpoll']}</a></strong></li>
		</if>
	</ul>
	{$forum['pagenav']}
</div>
<if="$bboptions['showforumusers']">
<div id="onlineusers" class="ttable">
	<div class='thead'>
		{$lang['onlineusers']}
	</div>
	<if="$online[username] && is_array($online[username])">
	<div class='item_list'>
		<ul>
			<foreach="$online['username'] as $data">
				<li>
				<if="$data['userid']">
					<a href='profile.php{sessionurl}u={$data['userid']}' title='{$data['lastactivity']}'>{$data['usericon']}{$data['opentag']}{$data['username']}{$data['closetag']}</a>
				<else>
					{$data['usericon']}{$data['username']}
				</if>
				<if="$data['mobile']">
					<img src='images/<#IMAGE#>/mobile.gif' class="inline" alt='' />
				</if>
				<if="$data['show_icon']">
					*
				</if>
				</li>
			</foreach>
		</ul>
	</div>
	</if>
</div>
</if>
<div class="separate"><!-- separate block --></div>
<div class="ttable thead">
	<div style="float:right;">
		{$forum[forum_jump]}
	</div>
	<form action='forumdisplay.php{sessionurl}f={$forum['id']}&amp;pp={$pp}' method='post'>
		{$lang['threadby']}
		<select name='sortby' class="select_normal">
			{$show['sort_by']}
		</select>
		{$lang['threadshow']}
		<select name='daysprune' class="select_normal">
			{$show['sort_prune']}
		</select>
		{$lang['is']}
		<select name='filter' class="select_normal">
			{$show['thread_filter']}
		</select>
		<input type='submit' class="button_normal" value='{$lang['_ok']}' />
	</form>
</div>
</if>
{template:footer}